package com.lc.demo.mapper;

import com.lc.demo.bean.Admin;
import com.lc.demo.bean.Teacher;
import org.apache.ibatis.annotations.*;

/**
 * @ClassName AdminMapper
 * @Deacription TODO
 * @Author jinshuhan
 * @Version 1.0
 **/

@Mapper
public interface AdminMapper {


    @Select("select * from admin where  username=#{username} and password=#{password}")
    Admin login(@Param("username") String username,@Param("password") String password);


    @Insert("insert into  teacher (username,password,name) values(#{username},#{password},#{name}) ")
    void addTeacher(Teacher teacher);


    @Update("update teacher set username=#{username},password=#{password},name=#{name} where id =#{id}")
    void updateTeacher(Teacher teacher);

    @Delete("delete from teacher where id=#{id}")
    void delTeacher(Teacher teacher);

    @Select("select * from admin where username=#{username}")
    Admin findByUsername(@Param("username") String username);
}
